#ifndef _MOTOR_H
#define _MOTOR_H

/* Includes ----------------------------------------------------------------- */
#include <tim.h>

#include "../algorithm/integration.h"
#include "../device/oled.h"
#include "filter.h"

/* Exported constants ------------------------------------------------------- */
/* Exported macro ----------------------------------------------------------- */
/* Exported types ----------------------------------------------------------- */
typedef enum { MOTOR1 = 0, MOTOR2, MOTOR3, MOTOR4, MOTOR_NUM } MotorType_t;

typedef enum {
  OUT = 0,
  IN = 1,
} MotorDirection_t;

typedef struct {
  float speed;
  uint8_t polarity;
  MotorType_t type;
} Motor_t;

/* Exported functions prototypes -------------------------------------------- */
void Motor_Init(void);
int8_t Motor_axis(Motor_t *motor);
#ifdef __cplusplus
}
#endif
#endif
